package cn.ticket.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.ticket.model.Seatmap;
import cn.ticket.service.SeatmapService;
import cn.ticket.service.Utility;

@RequestMapping("/map")
@Controller
public class MapController {
	@Autowired
	SeatmapService seatMapService;
	@RequestMapping(value="/lifeMap")
	public String lifeMap(){
		
		return "lifeMap";
	}
	
	@RequestMapping(value="/seatMap")
	public String seatMap(){
		
		return "seatMap";
	}
	@RequestMapping(value="getSeatMapData",method=RequestMethod.GET,produces={"application/json;charset=utf-8"})
	@ResponseBody
	public String getSeatMapData(){
		List<Seatmap> seatmaps=seatMapService.getAll();
		return Utility.createJsonMsg(1001, "success", seatmaps);
	}
	
}
